﻿@using YL.Core.Dto
@model string
@{
    var menus = ViewData["menu"] as List<PermissionMenu>;
}
<!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <section class="sidebar">

            <!-- Sidebar user panel -->
            @*<div class="user-panel">
                <div class="pull-left image">
                    <img src="~/@ViewBag.headimg" class="img-circle" alt="User Image" />
                </div>
                <div class="pull-left info">
                    <p>@ViewBag.nickname</p>
                    <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                </div>
            </div>*@

            <!-- search form -->
            @*<form action="#" method="get" class="sidebar-form" onsubmit="return false">
                <div class="input-group">
                    <input type="text" name="q" class="form-control" placeholder="Search...">
                    <span class="input-group-btn">
                        <button type="submit" name="search" id="search-btn" class="btn btn-flat">
                            <i class="fa fa-search"></i>
                        </button>
                    </span>
                </div>
            </form>*@
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu" data-widget="tree">
                @*<li class="header">MAIN NAVIGATION</li>*@

                @*<li class="active treeview">*@
                @*<li class="treeview">
                    <a href="#">
                        <i class="fa fa-dashboard"></i> <span>Dashboard</span>
                        <span class="pull-right-container">
                            <i class="fa fa-angle-left pull-right"></i>
                        </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/Home"><i class="fa fa-circle-o"></i> Dashboard v1</a></li>
                    </ul>
                </li>*@
                @{
                    if (menus.Count > 0)
                    {
                        foreach (var item in menus)
                        {
                            <li class="treeview">
                                <a href="javascript:;">
                                    <i class="fa fa-pie-chart"></i>
                                    <span>@item.Name</span>
                                    <span class="pull-right-container">
                                        <i class="fa fa-angle-left pull-right"></i>
                                    </span>
                                </a>
                                <ul class="treeview-menu active">
                                    @foreach (var item2 in item.Children)
                                    {
                                        <li ref="@item2.Url?.Replace("/","")"><a href="@item2.Url"><i class="fa fa-circle-o"></i> @item2.Name</a></li>
                                    }
                                </ul>
                            </li>
                        }
                    }
                }
            </ul>
        </section>
    </aside>